package br.com.ngame.core;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;

public class BasicPauseLevel extends GameLevel
{
	boolean fading;
	
	public void load()
	{
		fading = true;
	}

	public void unload()
	{
	}

	public void updateLogic(int frameCount)
	{
		if (frameCount > 20)
			fading = false;
	}
	
	public void render(Graphics2D screenBuffer)
	{
		screenBuffer.setPaint( Color.black );
		if (fading)
		{
			screenBuffer.setComposite( AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f));
			screenBuffer.fillRect(0, 0, getGame().getVideoDevice().getWidth(), getGame().getVideoDevice().getHeight());
			screenBuffer.setComposite( AlphaComposite.getInstance(AlphaComposite.SRC));
		}
		Rectangle2D r = new Rectangle2D.Float( getGame().getVideoDevice().getWidth()/2-40,
											   getGame().getVideoDevice().getHeight()/2-15,
											   80, 30);
		screenBuffer.fill(r);

		screenBuffer.setColor( Color.white );
		screenBuffer.drawString("EM PAUSA", getGame().getVideoDevice().getWidth()/2-30, getGame().getVideoDevice().getHeight()/2+5);
	}
}